//新闻文章接口
import request from '../utils/request'
//文章列表
export const getPostAPI = (params) => {
    return request({
        // method不写默认为get
        url: '/post',
        params
    })
}
//文章详情
export const getPostDetailAPI = (id) => {
    return request({
        method:'GET',
        url: `/post/${id}`,
        
    })
}

//文章点赞
export const updataPostLikeAPI = (id) => {
    return request({
       
        url: `/post_like/${id}`,
        
    })
}


//收藏文章
export const postCollectAPI = (id) => {
    return request({
        url: `/post_star/${id}`,
    })
}

//评论列表 
export const getPostcommentAPI = (id,params) => {
    return request({
        url: `/post_comment/${id}`,
        params
    })
}

//发表评论
export const PostcommentAPI = (id,data) => {
    return request({
        method:'POST',
        url: `/post_comment/${id}`,
        data
    })
}

//搜索文章
export const PostSearchAPI = (params) => {
    return request({
        method: 'GET',
        url: '/post_search',
        params      
    })
}

//发布文章
export const PostPubLishAPI = (data) => {
    return request({
        method: 'POST',
        url: '/post',
        data    
    })
}

 